<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>用户登录</title>
  <!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
  <script src="libs/jquery-1.12.1.min.js"></script>
  <link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
  <script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
  <script src="libs/md5.min.js"></script>
   <script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>
  <div class="container">
    <div class="row">
      <div class="col-md-12 page-header">
        <h2 class="text-center">Archive<br/><small>用户登录</small></h2>
      </div>
    </div>
  </div>
  <div class="container">
    <div class="row">
      <div class="col-md-4 col-md-offset-4">
        <div class="form-group">
          <label for="account">账号</label>
          <input type="text" class="form-control" id="account"/>
        </div>
        <div class="form-group">
          <label for="password">密码</label>
          <input type="password" class="form-control" id="password"/>
        </div>
        <button id="login" class="btn btn-primary btn-block">登录</button>
      </div>
    </div>
  </div>
  <script type="text/javascript">
  $.backstretch("101.jpg");
  </script>
   <script type="text/javascript">
  $(function () {
	    $('#login').click(function () {
	        $.post('login.action', {
	        account: $('#account').val(),
	        
	        password : md5($('#password').val()),
	       
	      }, function (res, status) {
	        if ('OK' == res) {
	          alert('登录成功');
	          window.location.href="index.html";
	        } else if ('ERR' == res) {
	          alert('账号或密码错误');
	        }
	      });
	    });
	  });

  </script>
</body>

</html>
 